﻿using EyFramework.Sys.Core;
using Ncov2019.Core.Dao;
using Ncov2019.Entity;
using Ncov2019.Entity.Dto;
using System.Collections.Generic;

namespace Ncov2019.Core.Service
{
    public class NcovBarConfirmService : BaseHisService, INcovBarConfirmService
    {
        protected readonly INcovBarConfirmDao _NcovBarConfirmDao;

        public NcovBarConfirmService(INcovBarConfirmDao ncovBarConfirmDao)
        {
            _NcovBarConfirmDao = ncovBarConfirmDao;
        }

        public bool AddNcovBarConfirm(NcovBarConfirm ncovBarConfirm)
        {
            ncovBarConfirm.CONFIRM_SEQ = GetHisMaxId("NCOV_BAR_CONFIRM", "CONFIRM_SEQ");
            return _NcovBarConfirmDao.Insert(ncovBarConfirm);
        }

        public bool Delete(long confirmSeq)
        {
            return _NcovBarConfirmDao.DeleteById(confirmSeq);
        }

        public bool Exists(NcovBarConfirm ncovBarConfirm)
        {
            List<NcovBarConfirm> ncovBarConfirms = _NcovBarConfirmDao.GetNcovBarConfirm(ncovBarConfirm);
            if (ncovBarConfirms.Count > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        public LisReportInfo GetLisReport(string bingrenid)
        {
            return _NcovBarConfirmDao.GetLisReport(bingrenid);
        }

        public NcovBarInfoDto GetNcovBarInfo(string barCode)
        {
            return _NcovBarConfirmDao.GetNcovBarInfo(barCode);
        }

        /// <summary>
        /// 获取流调登记信息
        /// </summary>
        /// <param name="ncovInfoParam"></param>
        /// <returns></returns>
        public List<NcovInfo> QueryNcovInfo(NcovInfoParam ncovInfoParam)
        {
            return _NcovBarConfirmDao.QueryNcovInfo(ncovInfoParam);
        }

        public List<NcovBarConfirm> queryTodayData(NcovBarConfirmParam ncovBarConfirmParam)
        {
            return _NcovBarConfirmDao.queryTodayData(ncovBarConfirmParam);
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="lisPatInfo"></param>
        /// <returns></returns>
        public bool UpdateLisPatInfo(LisPatInfoDto lisPatInfo)
        {
            return _NcovBarConfirmDao.UpdateLisPatInfo(lisPatInfo);
        }
    }
}